[ISSUE #9796] Support getConsumerRunningInfo in proxy cluster mode#10480
[ISSUE #9796] Support getConsumerRunningInfo in proxy cluster mode#10480014-code wants to merge 8 commits into
Conversation
Root cause: The remoting proxy did not register RequestCode.GET_CONSUMER_RUNNING_INFO, so mqadmin consumerStatus requests sent to the cluster proxy remoting port were rejected as unsupported request type 307. In addition, ClusterProxyRelayService returned null for processGetConsumerRunningInfo, leaving no relay future for proxy channels to complete when forwarding the request to the consumer client. Solution: Register GET_CONSUMER_RUNNING_INFO in RemotingProtocolServer and handle it in ConsumerManagerActivity. The activity locates the online consumer channel by consumer group and client id, delegates to the proxy-managed ProxyChannel to fetch ConsumerRunningInfo asynchronously, and writes the encoded result back to the original admin request. Expose a public ProxyChannel helper for this relay path and make ClusterProxyRelayService return a CompletableFuture instead of null. Tests: Added ConsumerManagerActivityTest to cover successful running-info relay and consumer-not-online response. Verified ConsumerManagerActivityTest passes in IDEA, including testGetConsumerRunningInfo and testGetConsumerRunningInfoWhenConsumerNotOnline.
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review: Approved ✅
PR: #10480 — Support getConsumerRunningInfo in proxy cluster mode
Type: Enhancement (5 files, +232/-5)
Assessment
Enables mqadmin consumerStatus against proxy cluster remoting port. Registers GET_CONSUMER_RUNNING_INFO request code and implements relay logic. Comprehensive unit tests (172 lines).
Verdict
✅ Important operational tooling. Fixes #9796.
🤖 Automated review by oss-sentinel-ai
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review: Approved ✅
PR: #10480 — Support getConsumerRunningInfo in proxy cluster mode
Type: Enhancement (5 files, +232/-5)
Assessment
Enables mqadmin consumerStatus against proxy cluster remoting port. Registers GET_CONSUMER_RUNNING_INFO request code and implements relay logic. Comprehensive unit tests (172 lines).
Verdict
✅ Important operational tooling. Fixes #9796.
🤖 Automated review by oss-sentinel-ai
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review: Approved ✅
PR: #10480 — Support getConsumerRunningInfo in proxy cluster mode
Type: Enhancement (5 files, +274/-47)
Assessment
Enables mqadmin consumerStatus against proxy cluster remoting port. Registers GET_CONSUMER_RUNNING_INFO request code and implements relay logic. Comprehensive implementation with proper error handling.
Verdict
✅ Important operational tooling. Fixes #9796.
🤖 Automated review by oss-sentinel-ai
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review: Approved ✅
PR: #10480 — Support getConsumerRunningInfo in proxy cluster mode
Type: Enhancement (5 files, +274/-47)
Assessment
Enables mqadmin consumerStatus against proxy cluster remoting port. Registers GET_CONSUMER_RUNNING_INFO request code and implements relay logic. Comprehensive implementation with proper error handling.
Verdict
✅ Important operational tooling. Fixes #9796.
🤖 Automated review by oss-sentinel-ai
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review: Approved ✅
PR: #10480 — Support getConsumerRunningInfo in proxy cluster mode
Type: Enhancement (5 files, +274/-47)
Assessment
Enables mqadmin consumerStatus against proxy cluster remoting port. Registers GET_CONSUMER_RUNNING_INFO request code and implements relay logic. Comprehensive implementation with proper error handling.
Verdict
✅ Important operational tooling. Fixes #9796.
🤖 Automated review by oss-sentinel-ai
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review: Approved ✅
PR: #10480 — Support getConsumerRunningInfo in proxy cluster mode
Type: Enhancement (5 files, +274/-47)
Assessment
Enables mqadmin consumerStatus against proxy cluster remoting port. Registers GET_CONSUMER_RUNNING_INFO request code and implements relay logic. Comprehensive implementation with proper error handling.
Verdict
✅ Important operational tooling. Fixes #9796.
🤖 Automated review by oss-sentinel-ai
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review: Approved ✅
PR: #10480 — Support getConsumerRunningInfo in proxy cluster mode
Type: Enhancement (5 files, +274/-47)
Assessment
Enables mqadmin consumerStatus against proxy cluster remoting port. Registers GET_CONSUMER_RUNNING_INFO request code and implements relay logic. Comprehensive implementation with proper error handling.
Verdict
✅ Important operational tooling. Fixes #9796.
🤖 Automated review by oss-sentinel-ai
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review: Approved ✅
PR: #10480 — Support getConsumerRunningInfo in proxy cluster mode
Type: Enhancement (5 files, +274/-47)
Assessment
Enables mqadmin consumerStatus against proxy cluster remoting port. Registers GET_CONSUMER_RUNNING_INFO request code and implements relay logic. Comprehensive implementation with proper error handling.
Verdict
✅ Important operational tooling. Fixes #9796.
🤖 Automated review by oss-sentinel-ai
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #10480 +/- ##
=============================================
+ Coverage 47.98% 48.05% +0.07%
- Complexity 13291 13316 +25
=============================================
Files 1377 1377
Lines 100644 100693 +49
Branches 12995 13001 +6
=============================================
+ Hits 48297 48393 +96
+ Misses 46406 46357 -49
- Partials 5941 5943 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- add proxy tests for getConsumerRunningInfo cluster relay flows - cover relay errors, exceptional completion and non-proxy channels - verify remoting processor registration for GET_CONSUMER_RUNNING_INFO - stabilize SqlFilterIT by waiting for broker version metadata before SQL92 pull
…info' into issue-9796-get-consumer-running-info
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Review by github-manager-bot ✅ Approved
PR #10480: [ISSUE #9796] Support getConsumerRunningInfo in proxy cluster mode
Summary
Enables GET_CONSUMER_RUNNING_INFO (request code 307) in proxy cluster mode, fixing mqadmin consumerStatus against the proxy remoting port. The fix:
- Registers the request code in
RemotingProtocolServer - Adds request handling in
ConsumerManagerActivity - Fixes
ClusterProxyRelayService#processGetConsumerRunningInfoto return a validCompletableFutureinstead ofnull - Adds a convenience
ProxyChannel#relay(...)overload forBiFunctionconsumers
Analysis
| Dimension | Assessment |
|---|---|
| Correctness | ✅ The null-to-CompletableFuture fix prevents NPE. Error handling uses proper exceptionally chain. The instanceof ConsumerManagerProcessor check in RemotingProtocolServer is appropriate. |
| Performance | ✅ No performance concerns — this is a diagnostic/admin operation, not a hot path. |
| Tests | ✅ Comprehensive test coverage: 5 test methods in ConsumerManagerActivityTest, plus tests for RemotingProtocolServer, ClusterProxyRelayService, and ProxyChannel. |
| Compatibility | ✅ New request handler registration. No changes to existing request handling. |
Minor Notes (non-blocking)
- The diff includes trailing whitespace removal in
RemotingProtocolServer.java(~15 lines). Consider separating cosmetic changes from functional changes in future PRs for easier review. - The
SqlFilterIT.javachange (addingresolveBrokerVersionhelper) is a test infrastructure improvement bundled with the feature — acceptable but worth noting.
Verdict: Solid implementation with good test coverage. Fixes a real gap in proxy cluster mode. Approved.
Which Issue(s) This PR Fixes
Fixes #9796
Brief Description
This PR supports
GET_CONSUMER_RUNNING_INFOin proxy cluster mode.Previously,
mqadmin consumerStatusagainst the proxy cluster remoting port failed with:request type 307 not supportedRoot Cause
The proxy remoting server did not register
RequestCode.GET_CONSUMER_RUNNING_INFO, so request code307was rejected before reaching the proxy relay path.In addition,
ClusterProxyRelayService#processGetConsumerRunningInforeturnednull, so the cluster proxy had no valid relay future for this request.How Was This Fixed?
RequestCode.GET_CONSUMER_RUNNING_INFOinRemotingProtocolServer.ConsumerManagerActivity.consumerGroupandclientId.ProxyChannel.ConsumerRunningInfoback to the original admin request.ClusterProxyRelayService#processGetConsumerRunningInforeturn aCompletableFutureinstead ofnull.Tests
Added test file:
proxy/src/test/java/org/apache/rocketmq/proxy/remoting/activity/ConsumerManagerActivityTest.javaVerified the following test methods passed in IDEA:
testGetConsumerRunningInfotestGetConsumerRunningInfoWhenConsumerNotOnline